﻿using System.ComponentModel;
using System.Configuration.Install;
using Microsoft.Win32;

namespace SpicIE
{
    [RunInstaller(true)]
    public partial class SpiceIEInstaller : Installer
    {
        public SpiceIEInstaller()
        {
            InitializeComponent();
        }

        private string GetVS8SDKPath()
        {
            string devenv = "";
            using (RegistryKey setupKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS"))
            {
                if (setupKey != null)
                {
                    devenv = setupKey.GetValue("ProductDir").ToString()+"sdk\\v2.0\\bin\\";
                    
                }
            }

            return (devenv);

        }

        //public override void Install(System.Collections.IDictionary stateSaver)
        //{
        //    base.Install(stateSaver);            
            
        //    //// COM Registrierung
        //    RegistrationServices regsrv = new RegistrationServices();
        //    if (!regsrv.RegisterAssembly(this.GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase))
        //    {
        //        throw new InstallException("Failed To Register for COM");
        //    }
        //}

        //public override void Uninstall(System.Collections.IDictionary savedState)
        //{
        //    base.Uninstall(savedState);

        //    RegistrationServices regsrv = new RegistrationServices();
        //    if (!regsrv.UnregisterAssembly(this.GetType().Assembly))
        //    {
        //        throw new InstallException("Failed To Unregister for COM");
        //    }
            
        //}
    }
}
